<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ProductAttributeList.ascx.cs" Inherits="HUGATE.Item.Controls.ProductAttribute.ProductAttributeList" %>
<%@ Register Src="ProductAttributeEdit.ascx" TagName="ProductAttributeEdit" TagPrefix="uc1" %>
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
 <tbody>
    <tr>
        <td style="width: 90px; height: 94px">
            <%=HUGATE.Utility.ResxManager.GetString("SearchString") + ":"%>
        </td>
        <td style="width: 150px; height: 94px">
            <asp:TextBox ID="txtSearch" runat="server" MaxLength="200" CssClass ="TextBox1" 
             onkeyup ="return PerformClick(event, '<%=btnSearch.ClientID %>');"></asp:TextBox></td>
        <td style="width: auto; height: 94px">
           <asp:Button ID="btnSearch" OnClick="btnSearch_Click" CssClass="Control_Button1" runat="server">
                </asp:Button>
                <asp:Button ID="btnAddNew" OnClick="btnAddNew_Click" CssClass="Control_Button1" runat="server">
                </asp:Button>
                <asp:Button ID="btnReturn" CssClass="Control_Button1" runat="server" UseSubmitBehavior="False">
                </asp:Button></td>
        <td style="width: 100px; height: 94px">
            <asp:UpdateProgress ID="UpdateProgress1" runat="server" DisplayAfter="10">
              <ProgressTemplate>
                        &nbsp;
                        <img alt="" src='<%=CoreLibs.Globals.ApplicationVRoot() +"/App_Themes/Default/Images/System/ajaxload.gif" %>' id="IMG1" onclick="return IMG1_onclick()" />
                    </ProgressTemplate>
            </asp:UpdateProgress>
        </td>
    </tr>
    </tbody>
</table>
<asp:UpdatePanel ID="udpList" runat="server" UpdateMode="Conditional">
    <contenttemplate>
        <asp:GridView ID="grvObject" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            CssClass="Gridview" DataKeyNames="AttributeID" OnPageIndexChanging="grvObject_PageIndexChanging"
            OnSelectedIndexChanged="grvObject_SelectedIndexChanged" PageSize="20" 
            Width="100%" onrowdatabound="grvObject_RowDataBound">
            <EmptyDataTemplate>
                <center>
                    <%#HUGATE.Utility.ResxManager.GetString("BUTEmptyData")%>
                </center>
            </EmptyDataTemplate>
            <Columns>
                <asp:BoundField DataField="AttributeID">
                    <ItemStyle CssClass="Gridview_Column_ID" />
                </asp:BoundField>
                <asp:BoundField DataField="AttributeName">
                    <ItemStyle Width="200px" />
                </asp:BoundField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <%#Eval("Description").ToString().Replace("\n","<BR />" )%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:Label id="lbAttributeType" runat="server" Text='<%# Bind("AttributeType")%>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                 <asp:BoundField DataField="Level">
                    <ItemStyle Width="200px" HorizontalAlign="Center" />
                </asp:BoundField>
                 <asp:BoundField DataField="NodeTree">
                    <ItemStyle Width="200px" HorizontalAlign="Center" />
                </asp:BoundField>
                 <asp:TemplateField ShowHeader="False">
                    <ItemStyle CssClass="Update" />
                    <ItemTemplate>
                    <asp:TreeView ID="tvChildAttribute" runat="server" style="float:left" 
                            CollapseImageUrl="~/App_Themes/Default/Images/TreeLineImages/Collapse.gif" 
                            ExpandImageUrl="~/App_Themes/Default/Images/TreeLineImages/Expand.gif" 
                            ShowLines="True" ></asp:TreeView>
                        <asp:Label ID="lbAttributeID" runat="server" Text='<%# Eval("AttributeID") %>' 
                            Visible="False"></asp:Label>
                        <br />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:CheckBoxField DataField="IsActived">
                    <ItemStyle HorizontalAlign="Center" Width="70px" />
                </asp:CheckBoxField>
                <asp:TemplateField ShowHeader="False">
                    <ItemStyle CssClass="Update" />
                    <ItemTemplate>
                        <asp:LinkButton ID="lbtEdit" runat="server" CommandArgument='<%#Eval("AttributeID")%>'
                            CommandName="Select" CssClass="UpdateBtn" ToolTip='<%#ResxManager.GetString("Btn_Update")%>' OnClick="lbtEdit_Click">
                        </asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:LinkButton ID="lbtDelete" runat="server" CommandArgument='<%#Eval("AttributeID")%>'
                            CssClass="DeleteBtn" OnClick="imgDelete_Click" OnClientClick='<%# "return confirm(\"" + string.Format(ResxManager.GetString("DeleteConfirm"), "") + "\");" %>'
                            ToolTip='<%#ResxManager.GetString("Delete")%>'>
                        </asp:LinkButton>
                    </ItemTemplate>
                    <ItemStyle CssClass="Delete" />
                </asp:TemplateField>
            </Columns>
            <RowStyle CssClass="Row" />
            <PagerStyle CssClass="Pager" />
            <HeaderStyle CssClass="Header" />
            <AlternatingRowStyle CssClass="RowAlt" />
        </asp:GridView>
    </contenttemplate>
    <triggers>
        <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
    </triggers>
</asp:UpdatePanel>
<asp:UpdatePanel ID="udpEdit" runat="server" UpdateMode="Conditional">
    <contenttemplate>
        <asp:Panel ID="pnlUpdate" runat="server" CssClass="Popup_Table" Style="display: none;
            width: 450px">
            <div class="Popup_Title">
                <table border="0" cellpadding="0" cellspacing="0" class="Popup_Title" style="width: 100%">
                    <tbody>
                        <tr>
                            <td>
                                <strong>
                                    <asp:Label ID="lblTitle" runat="server"></asp:Label>
                                    </strong></td>
                            <td align="center" style="padding-right: 2px; width: 20px">
                                <div class="Popup_BtClose" style="width: 17px; height: 17px; text-align: center">
                                    <asp:LinkButton ID="lnkClose" runat="server" CssClass="Popup_BtClose" Height="17px"
                                        Width="17px" onclick="lnkClose_Click"></asp:LinkButton>
                                </div>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div class="Popup_Content">
              <uc1:ProductAttributeEdit ID="ctrlProductAttributeEdit" runat="server" />
            </div>
            <div id="divControl" runat="server" style="display: none">
            </div>
            <ajaxToolkit:ModalPopupExtender ID="mpeUpdate" runat="server" BackgroundCssClass="ModalPopupBackground" PopupControlID="pnlUpdate" TargetControlID="divControl" ></ajaxToolkit:ModalPopupExtender>
        </asp:Panel>
    </contenttemplate>
    <triggers>
        <asp:AsyncPostBackTrigger ControlID="btnAddNew" EventName="Click" />
    </triggers>
</asp:UpdatePanel>






